package com.woniuxy.dao;

import com.woniuxy.controller.dto.RepairLogDto;
import com.woniuxy.dao.model.RepairLog;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 维修日志表 Mapper 接口
 * </p>
 *
 * @author Keep it simple
 * @since 2022-06-28
 */
public interface RepairLogDao extends BaseMapper<RepairLog> {


    @Select("SELECT a.account_name repairname,operReason,(UNIX_TIMESTAMP(operDate) - UNIX_TIMESTAMP(repairDate))/60 resptime, rl.operDate,rl.repairState state FROM repair_info ri \n" +
            "JOIN repair_log rl \n" +
            "ON rl.repairNum=ri.repairNum\n" +
            "JOIN account a\n" +
            "ON a.id=rl.operUser AND ri.repairNum=#{repairNum}")
    List<RepairLogDto> all(@Param("repairNum") String repairNum);//获取某个订单的状态
}
